package com.example.online_exam_system.utils;

import java.util.ArrayList;
import java.util.List;

/**
 * @Description
 * @Author lianglong
 * @Since 2021/12/14 1:48
 **/
public class HAUtils{
	public static <T> List<T> castList(Object obj, Class<T> clazz) {
		List<T> result = new ArrayList<T>();
		if(obj instanceof List<?>)
		{
			for (Object o : (List<?>) obj)
			{
				result.add(clazz.cast(o));
			}
			return result;
		}
		return null;
	}

}

